﻿#ifndef _OI_COMMUNICATION_DSPLCTASK_HPP_
#define _OI_COMMUNICATION_DSPLCTASK_HPP_

#include <QThread>

namespace Oi
{
    namespace PLScannerCore
    {
        class PLScannerOutput;
        class ProductParams;
        class ProductStatus;

        class OI_PLSCANNER_CORE_API DSPlcTask : public QThread
        {
            Q_OBJECT

        public:
            DSPlcTask(QObject* parent = nullptr);

            ~DSPlcTask();

        public:
            void init();
            void exit();

        public:
            void run();
            void quit();
            void start();

        public:
            bool write(const PLScannerOutput& ouput);
            bool readParams(ProductParams& params);
            bool readStatus(ProductStatus& status);

        public:
            static DSPlcTask* instance();

        private:
            OI_DISABLE_COPY(DSPlcTask);
            OI_DECLARE_IMPL(DSPlcTask);

        };

    }

}


#endif